# 指定CMake最低版本要求
cmake_minimum_required(VERSION 3.10)

# 设置项目名称和版本
project(do-server VERSION 1.0 LANGUAGES C CXX)

# 设置C++标准
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

# 添加可执行文件
add_executable(${PROJECT_NAME}
    src/main.cpp
    src/auth.cpp
    src/database.cpp
    src/messagerouter.cpp
    src/response.cpp
    src/threadpool.cpp    
    src/common.cpp  
    src/service.cpp
    src/jsoncpp.cpp
)

# 添加头文件目录
target_include_directories(${PROJECT_NAME} PRIVATE
    src/include
)

# 启用线程支持
find_package(Threads REQUIRED)

# 链接库
target_link_libraries(${PROJECT_NAME} PRIVATE
    Threads::Threads
    ${CMAKE_CURRENT_SOURCE_DIR}/lib/sqlite3/libsqlite3.a
)